<template>
  <div id="full-screen" @click="handleFullScreen">
    <i class="iconfont icon-quanping" />
  </div>
</template>

<script>
import screenfull from 'screenfull'

export default {
  setup() {
    const handleFullScreen = () => {
      if (screenfull.isEnabled) {
        screenfull.isFullscreen ? screenfull.exit() : screenfull.request()
      }
    }

    return {
      handleFullScreen
    }
  }
}
</script>

<style lang="scss" scoped>
#full-screen {
  cursor: pointer;
  .anticon {
    font-size: 20px;
  }
}
</style>
